<template>
  <header class="header">
    <h1>新闻网站</h1>
    <div class="nav">
      <a href="#" v-for="navItem in navItems" :key="navItem">{{ navItem }}</a>
    </div>
  </header>
</template>

<script setup>
import { ref } from 'vue'

const navItems = ref(['首页', '国内', '国际', '娱乐', '体育', '科技'])
</script>

<style scoped>
.header {
  background-color: #283645;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.header h1 {
  font-size: 28px;
  margin: 0;
  color: white;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  transition: color 0.3s;
}

.nav a:hover {
  color: #ccc;
}
</style>
